Integrand size = 31, antiderivative size = 71 \[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\frac {2 (a A-b B) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 (A b+a B) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{d}+\frac {2 b B \sin (c+d x)}{d \sqrt {\cos (c+d x)}} \]
2*(A*a-B*b)*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticE(sin( 1/2*d*x+1/2*c),2^(1/2))/d+2*(A*b+B*a)*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2 *d*x+1/2*c)*EllipticF(sin(1/2*d*x+1/2*c),2^(1/2))/d+2*b*B*sin(d*x+c)/d/cos (d*x+c)^(1/2)
Time = 0.98 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.90 \[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\frac {2 \left ((a A-b B) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+(A b+a B) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )+\frac {b B \sin (c+d x)}{\sqrt {\cos (c+d x)}}\right )}{d} \]
(2*((a*A - b*B)*EllipticE[(c + d*x)/2, 2] + (A*b + a*B)*EllipticF[(c + d*x )/2, 2] + (b*B*Sin[c + d*x])/Sqrt[Cos[c + d*x]]))/d
Time = 0.60 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.387, Rules used = {3042, 3433, 3042, 3447, 3042, 3500, 27, 3042, 3227, 3042, 3119, 3120}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )} \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx\) |
\(\Big \downarrow \) 3433 |
\(\displaystyle \int \frac {(a \cos (c+d x)+b) (A \cos (c+d x)+B)}{\cos ^{\frac {3}{2}}(c+d x)}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a \sin \left (c+d x+\frac {\pi }{2}\right )+b\right ) \left (A \sin \left (c+d x+\frac {\pi }{2}\right )+B\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^{3/2}}dx\) |
\(\Big \downarrow \) 3447 |
\(\displaystyle \int \frac {(a B+A b) \cos (c+d x)+a A \cos ^2(c+d x)+b B}{\cos ^{\frac {3}{2}}(c+d x)}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a B+A b) \sin \left (c+d x+\frac {\pi }{2}\right )+a A \sin \left (c+d x+\frac {\pi }{2}\right )^2+b B}{\sin \left (c+d x+\frac {\pi }{2}\right )^{3/2}}dx\) |
\(\Big \downarrow \) 3500 |
\(\displaystyle 2 \int \frac {A b+a B+(a A-b B) \cos (c+d x)}{2 \sqrt {\cos (c+d x)}}dx+\frac {2 b B \sin (c+d x)}{d \sqrt {\cos (c+d x)}}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \int \frac {A b+a B+(a A-b B) \cos (c+d x)}{\sqrt {\cos (c+d x)}}dx+\frac {2 b B \sin (c+d x)}{d \sqrt {\cos (c+d x)}}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A b+a B+(a A-b B) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}}dx+\frac {2 b B \sin (c+d x)}{d \sqrt {\cos (c+d x)}}\) |
\(\Big \downarrow \) 3227 |
\(\displaystyle (a B+A b) \int \frac {1}{\sqrt {\cos (c+d x)}}dx+(a A-b B) \int \sqrt {\cos (c+d x)}dx+\frac {2 b B \sin (c+d x)}{d \sqrt {\cos (c+d x)}}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle (a B+A b) \int \frac {1}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}}dx+(a A-b B) \int \sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {2 b B \sin (c+d x)}{d \sqrt {\cos (c+d x)}}\) |
\(\Big \downarrow \) 3119 |
\(\displaystyle (a B+A b) \int \frac {1}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}}dx+\frac {2 (a A-b B) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 b B \sin (c+d x)}{d \sqrt {\cos (c+d x)}}\) |
\(\Big \downarrow \) 3120 |
\(\displaystyle \frac {2 (a B+A b) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{d}+\frac {2 (a A-b B) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 b B \sin (c+d x)}{d \sqrt {\cos (c+d x)}}\) |
(2*(a*A - b*B)*EllipticE[(c + d*x)/2, 2])/d + (2*(A*b + a*B)*EllipticF[(c + d*x)/2, 2])/d + (2*b*B*Sin[c + d*x])/(d*Sqrt[Cos[c + d*x]])
3.6.65.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticE[(1/2)* (c - Pi/2 + d*x), 2], x] /; FreeQ[{c, d}, x]
Int[1/Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticF[(1/2 )*(c - Pi/2 + d*x), 2], x] /; FreeQ[{c, d}, x]
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b Int [(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
Int[((a_.) + csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]* (d_.) + (c_))^(n_.)*((g_.)*sin[(e_.) + (f_.)*(x_)])^(p_.), x_Symbol] :> Sim p[g^(m + n) Int[(g*Sin[e + f*x])^(p - m - n)*(b + a*Sin[e + f*x])^m*(d + c*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, g, p}, x] && NeQ[b*c - a*d, 0] && !IntegerQ[p] && IntegerQ[m] && IntegerQ[n]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x]^2), x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(A*b^2 - a*b*B + a^2*C))*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 1)* (a^2 - b^2))), x] + Simp[1/(b*(m + 1)*(a^2 - b^2)) Int[(a + b*Sin[e + f*x ])^(m + 1)*Simp[b*(a*A - b*B + a*C)*(m + 1) - (A*b^2 - a*b*B + a^2*C + b*(A *b - a*B + b*C)*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C}, x] && LtQ[m, -1] && NeQ[a^2 - b^2, 0]
Leaf count of result is larger than twice the leaf count of optimal. \(243\) vs. \(2(121)=242\).
Time = 8.28 (sec) , antiderivative size = 244, normalized size of antiderivative = 3.44
method | result | size |
default | \(-\frac {2 \left (A \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, b -A \operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, a -2 B \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b +B \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, a +B \operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, b \right )}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, d}\) | \(244\) |
-2*(A*EllipticF(cos(1/2*d*x+1/2*c),2^(1/2))*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/ 2)*(sin(1/2*d*x+1/2*c)^2)^(1/2)*b-A*EllipticE(cos(1/2*d*x+1/2*c),2^(1/2))* (2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*(sin(1/2*d*x+1/2*c)^2)^(1/2)*a-2*B*cos(1/ 2*d*x+1/2*c)*sin(1/2*d*x+1/2*c)^2*b+B*EllipticF(cos(1/2*d*x+1/2*c),2^(1/2) )*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*(sin(1/2*d*x+1/2*c)^2)^(1/2)*a+B*Ellipt icE(cos(1/2*d*x+1/2*c),2^(1/2))*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*(sin(1/2* d*x+1/2*c)^2)^(1/2)*b)/sin(1/2*d*x+1/2*c)/(2*cos(1/2*d*x+1/2*c)^2-1)^(1/2) /d
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.11 (sec) , antiderivative size = 185, normalized size of antiderivative = 2.61 \[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\frac {2 \, B b \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) + \sqrt {2} {\left (-i \, B a - i \, A b\right )} \cos \left (d x + c\right ) {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + \sqrt {2} {\left (i \, B a + i \, A b\right )} \cos \left (d x + c\right ) {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + \sqrt {2} {\left (i \, A a - i \, B b\right )} \cos \left (d x + c\right ) {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) + \sqrt {2} {\left (-i \, A a + i \, B b\right )} \cos \left (d x + c\right ) {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right )}{d \cos \left (d x + c\right )} \]
(2*B*b*sqrt(cos(d*x + c))*sin(d*x + c) + sqrt(2)*(-I*B*a - I*A*b)*cos(d*x + c)*weierstrassPInverse(-4, 0, cos(d*x + c) + I*sin(d*x + c)) + sqrt(2)*( I*B*a + I*A*b)*cos(d*x + c)*weierstrassPInverse(-4, 0, cos(d*x + c) - I*si n(d*x + c)) + sqrt(2)*(I*A*a - I*B*b)*cos(d*x + c)*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos(d*x + c) + I*sin(d*x + c))) + sqrt(2)*(-I*A *a + I*B*b)*cos(d*x + c)*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos(d*x + c) - I*sin(d*x + c))))/(d*cos(d*x + c))
\[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right ) \sqrt {\cos {\left (c + d x \right )}}\, dx \]
\[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\int { {\left (B \sec \left (d x + c\right ) + A\right )} {\left (b \sec \left (d x + c\right ) + a\right )} \sqrt {\cos \left (d x + c\right )} \,d x } \]
\[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\int { {\left (B \sec \left (d x + c\right ) + A\right )} {\left (b \sec \left (d x + c\right ) + a\right )} \sqrt {\cos \left (d x + c\right )} \,d x } \]
Time = 16.08 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.35 \[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\frac {2\,A\,a\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,A\,b\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,B\,a\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,B\,b\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (-\frac {1}{4},\frac {1}{2};\ \frac {3}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{d\,\sqrt {\cos \left (c+d\,x\right )}\,\sqrt {{\sin \left (c+d\,x\right )}^2}} \]